package org.example.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.entity.QuestionImportDTO;
import org.springframework.stereotype.Service;
import org.example.entity.QuestionInfoEntity;

import java.io.InputStream;
import java.util.List;
@Service
public interface QuestionInfoService extends IService<QuestionInfoEntity> {
    // 增加题目
    QuestionInfoEntity addQuestion(QuestionInfoEntity question);

    // 根据ID删除考题
    boolean deleteQuestionById(Long questionId);

    // 修改考题
    QuestionInfoEntity updateQuestion(QuestionInfoEntity question);

    // 根据ID查询考题
    QuestionInfoEntity getQuestionById(Long questionId);

    // 分页查询考题列表
    IPage<QuestionInfoEntity> getAllQuestions(Page<QuestionInfoEntity> page);

    // 根据条件查询考题（按科目，分页）
    IPage<QuestionInfoEntity> searchQuestionsBySubject(String subject, Page<QuestionInfoEntity> page);

    // 根据条件查询考题（按知识点和题目类型，分页）
    IPage<QuestionInfoEntity> searchQuestionsByKnowledgeAndType(String knowledge, String type, Page<QuestionInfoEntity> page);

    // 根据条件查询考题（按难度，分页）
    IPage<QuestionInfoEntity> searchQuestionsByDifficulty(byte difficulty, Page<QuestionInfoEntity> page);



    //根据考试ID差试卷中的所有题
      List<QuestionInfoEntity> getQuestionsByExamId(int examId);
    void removeDuplicates(Integer examId);

    public void importQuestions(List<QuestionImportDTO> questionList);
}
